<f:subview
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:nxl="http://nuxeo.org/nxforms/layout"
  xmlns:nxu="http://nuxeo.org/nxweb/util"
  xmlns:nxd="http://nuxeo.org/nxweb/document"
  xmlns:a4j="http://richfaces.org/a4j"
  id="#{layout.id}">

  <c:if test="false">
    Layout template applying to an item instance of PageSelections&lt;DocumentModel&gt; named "documents"
    in the search tab

    Other needed parameters are:
    - provider: instance of a PageProvider&lt;DocumentModel&gt; to handle sort
    - layoutListingStatus: iteration status, used to print table header
    matching widget label.
    - formId: the surrounding form id
  </c:if>

  <c:choose>
    <c:when test="#{useRepeatRenderTime}">
      <ui:fragment rendered="#{layoutListingStatus.index == 0}">
        <ui:include src="/layouts/layout_listing_thumbnail_template_header.xhtml" />
      </ui:fragment>
    </c:when>
    <c:otherwise>
      <c:if test="#{layoutListingStatus.index == 0}">
        <ui:include src="/layouts/layout_listing_thumbnail_template_header.xhtml" />
      </c:if>
    </c:otherwise>
  </c:choose>

  <ui:remove>for slideshow</ui:remove>
  <nxu:set var="blobInfo"
    value="#{blobHolderGenerator.getBlobHolder(value.data).blob.filename}"
    cache="#{!useRepeatRenderTime}">
    <h:outputLink value="#{contextPath}/api/v1/id/#{value.data.id}"
      class="image-popup visibilityH"
      rendered="#{not empty blobInfo and value.data.hasFacet('Picture')}" />
  </nxu:set>

  <c:set var="boxSelectedStyleClass" value="#{nxu:test(value.data.id == currentDocument.id, 'selectedItem', '')}" />
  <c:set var="infoViewUrl" value="#{nxd:complexDocumentUrl('id', value.data, 'info_view', null, true)}" />
  <div class="bubbleBox bubbleListing #{boxSelectedStyleClass}" data-docref="#{value.data.id}" data-infoviewurl="#{infoViewUrl}">
    <nxl:layout name="${layoutProperty_thumbnailHeaderLayout}" value="#{value}" mode="view" />
    <nxl:layoutColumn>
      <nxu:set var="divStyleClass" value="#{nxu:test(layoutColumn.properties.isBoxTitle, 'bubbleHeader', '')}">
        <div class="#{layoutColumn.properties.columnStyleClass} #{divStyleClass}" dir="auto">
          <nxl:layoutColumnWidget>
            <nxl:widget widget="#{widget}" value="#{value}" />
          </nxl:layoutColumnWidget>
        </div>
      </nxu:set>
    </nxl:layoutColumn>
  </div>

</f:subview>
